﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using AdaptiveHelpDesk;

namespace Novice
{
    /// <summary>
    /// Summary description for CallLogService
    /// </summary>
    [WebService(Namespace = "http://soaiui.nmmu.ac.za/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class CallLogService : System.Web.Services.WebService
    {

        [WebMethod]
        public string CallLogUpdate(String CallID, String cmbSolutionCause, String cmbSolutionResolved, String txtSolutionDesc)
        {
            String TodayDate = DateTime.Today.ToShortDateString().Replace('/', '-');
            String TodayTime = DateTime.Now.ToLongTimeString();
            String ret = "";

            StoredProcedures sp = new StoredProcedures();

            try
            {
                sp.updateCallLog(CallID, cmbSolutionCause, cmbSolutionResolved, txtSolutionDesc);
                ret = "success";
            }
            catch (Exception ex)
            {                
                return "Error occured while updating call log." + ex.Message;
            }

            return ret;
        }
    }
}
